package com.lu.dog.dbrowser.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.lu.adog.base.BaseActivity;
import com.lu.dog.dbrowser.R;
import com.lu.dog.dbrowser.bean.LogInfo;
import com.lu.dog.dbrowser.db.DBrowserDbHelper;
import com.lu.dog.dbrowser.ui.adapter.LogItemAdapter;

import java.util.List;

public class LogActivity extends BaseActivity {
    private RecyclerView rvLog;
    private List<LogInfo> summaryList;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log);

        rvLog = findViewById(R.id.rvLog);

        RecyclerView.LayoutManager layout = new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false);
        rvLog.setLayoutManager(layout);

        summaryList = DBrowserDbHelper.getInstance(this).selectAllLogInfoSummary();
        rvLog.setAdapter(new LogItemAdapter(this,R.layout.item_log,summaryList));
    }
}
